package com.cn.service.server.Equipment.Impl;

import com.cn.bean.dto.EquipmentoperationDto;
import com.cn.bean.pojo.PartsManagement.EquipmentBasicInfoTable;
import com.cn.bean.pojo.PartsManagement.EquipmentDisassemblySubTable;
import com.cn.bean.pojo.PartsManagement.EquipmentInstallationMainTable;
import com.cn.bean.pojo.PartsManagement.EquipmentInstallationSubTable;
import com.cn.bean.pojo.lbj.ComponentBasicInformationTable;
import com.cn.bean.pojo.lbj.ComponentSingleRegistrationTable;
import com.cn.bean.pojo.lbj.EquipmentCurrentComponentSingleCompositionTable;
import com.cn.bean.vo.Equipment.ComponentBasicInformation;
import com.cn.mapper.dao.db5.Equipment.EquipmentoperationDao;
import com.cn.service.server.Equipment.EquipmentoperationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class EquipmentoperationServiceImpl implements EquipmentoperationService {
    @Autowired(required=false)
    private EquipmentoperationDao equipmentoperationDao;
    @Override
    public List<EquipmentInstallationMainTable> selectEquipmentoperation(EquipmentInstallationMainTable equipmentInstallationMainTable) {
        return equipmentoperationDao.selectEquipmentoperation(equipmentInstallationMainTable);
    }

    @Override
    public List<EquipmentoperationDto> selectEquipmentInstallationSubTable(int id) {
        return equipmentoperationDao.selectEquipmentInstallationSubTable(id);
    }

    @Override
    public List<EquipmentoperationDto> selectEquipmentDisassemblySubTable(int id) {
        return equipmentoperationDao.selectEquipmentDisassemblySubTable(id);
    }

    @Override
    public List<EquipmentBasicInfoTable> selectEquipmentBasicInfoTable(EquipmentBasicInfoTable equipmentBasicInfoTable) {
        return equipmentoperationDao.selectEquipmentBasicInfoTable(equipmentBasicInfoTable);
    }

    @Override
    public List<ComponentBasicInformationTable> selectComponentBasicInformation(ComponentBasicInformationTable componentBasicInformation) {
        return equipmentoperationDao.selectComponentBasicInformation(componentBasicInformation);
    }

    @Override
    public List<EquipmentoperationDto> selectInstallationSubTable(int id) {
        return equipmentoperationDao.selectInstallationSubTable(id);
    }

    @Override
    public List<EquipmentoperationDto> selectDisassemblySubTable(int id) {
        return equipmentoperationDao.selectDisassemblySubTable(id);
    }

    @Override
    public List<EquipmentCurrentComponentSingleCompositionTable> selectEquipment(String uniqueCode) {
        return equipmentoperationDao.selectEquipment(uniqueCode);
    }

    @Override
    public int insertEquipmentInstallationMain(EquipmentInstallationMainTable equipmentInstallationMainTable) {
        Boolean a=equipmentoperationDao.insertEquipmentInstallationMain(equipmentInstallationMainTable);
        if (a){
            return 1;
        }
        return 0;
    }

    @Override
    public int insertEquipmentInstallationSub(EquipmentInstallationSubTable equipmentInstallationSubTable) {
        Boolean b=equipmentoperationDao.insertEquipmentInstallationSub(equipmentInstallationSubTable);
        if (b){
            return 1;
        }
        return 0;
    }

    @Override
    public int insertEquipmentDisassemblySubTable(EquipmentDisassemblySubTable equipmentDisassemblySubTable) {
        Boolean c=equipmentoperationDao.insertEquipmentDisassemblySubTable(equipmentDisassemblySubTable);
        if (c){
            return 1;
        }
        return 0;
    }

    @Override
    public int updateEquipmentInstallationMain(EquipmentInstallationMainTable equipmentInstallationMainTable) {
        Boolean d=equipmentoperationDao.updateEquipmentInstallationMain(equipmentInstallationMainTable);
        if (d){
            return 1;
        }
        return 0;
    }

    @Override
    public int delEquipmentInstallationSub(int id) {
        Boolean e=equipmentoperationDao.delEquipmentInstallationSub(id);
        if (e){
            return 1;
        }
        return 0;
    }

    @Override
    public int delEquipmentDisassemblySub(int id) {
        Boolean f=equipmentoperationDao.delEquipmentDisassemblySub(id);
        if (f){
            return 1;
        }
        return 0;
    }

    @Override
    public int updateAudit(int id) {
        Boolean z=equipmentoperationDao.updateAudit(id);
        if (z){
            return 1;
        }
        return 0;
    }

    @Override
    public Integer getMainAutoid() {
        return equipmentoperationDao.getMainAutoid();
    }

    @Override
    public Integer getEquipmentInstallationSubAutoid() {
        return equipmentoperationDao.getEquipmentInstallationSubAutoid();
    }

    @Override
    public Integer getEquipmentDisassemblyAutoid() {
        return equipmentoperationDao.getEquipmentDisassemblyAutoid();
    }

    @Override
    public int delMain(int id) {
        Boolean g=equipmentoperationDao.delMain(id);
        if (g){
            return 1;
        }
        return 0;
    }

    @Override
    public int delSubTable(int id) {
        Boolean h=equipmentoperationDao.delSubTable(id);
        if (h){
            return 1;
        }
        return 0;
    }

    @Override
    public int delDisassemblySubTable(int id) {
        Boolean j=equipmentoperationDao.delDisassemblySubTable(id);
        if (j){
            return 1;
        }
        return 0;
    }

    @Override
    public int insertCurrentComponent(EquipmentCurrentComponentSingleCompositionTable compositionTable) {
        Boolean k=equipmentoperationDao.insertCurrentComponent(compositionTable);
        if (k){
            return 1;
        }
        return 0;
    }

    @Override
    public int delCurrentComponent(EquipmentCurrentComponentSingleCompositionTable compositionTable) {
        Boolean v=equipmentoperationDao.delCurrentComponent(compositionTable);
        if (v){
            return 1;
        }
        return 0;
    }

    @Override
    public int updateComponentStatus(ComponentSingleRegistrationTable componentSingle) {
        Boolean t=equipmentoperationDao.updateComponentStatus(componentSingle);
        if (t){
            return 1;
        }
        return 0;
    }

    @Override
    public int completeWorkOrde(int workOrderNumber) {
        Boolean n=equipmentoperationDao.completeWorkOrde(workOrderNumber);
        if (n){
            return 1;
        }
        return 0;
    }
}
